Skip to content

patina_performance: Simplify configuration#1465

Open
Javagedes wants to merge 6 commits intoOpenDevicePartnership:majorfrom
Javagedes:personal/joeyvagedes/simplify-perf-config
Open

patina_performance: Simplify configuration#1465
Javagedes wants to merge 6 commits intoOpenDevicePartnership:majorfrom
Javagedes:personal/joeyvagedes/simplify-perf-config

Conversation

@Javagedes
Copy link
Copy Markdown
Contributor

@Javagedes Javagedes commented Apr 13, 2026

Description

patina_performance has a confusing configuration story. Prior to this change, configuration was done via patina Config, A platform could optionally register a secondary component that would read a HOB (if provided) and overwrite any Config with the HOB configuration.

This commit works to simplify the configuration story by making a couple of changes:

  1. Removal of the Config object. As stated in documentation throughout patina, Config is meant for configuration that is expected to be shared between multiple components. This particular configuration does not need to be shared, so it is moved to be private configuration of the component.
  2. Removal of the optional HOB reader driver. Now, a private configuration of the component will allow you to specify if the HOB is able to override local configuration or not.

This new story reduces patina_performance setup from three different definitions (Config, performance component, and hob component) to only one, the performance component.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

Reading final configuration of the performance component on Q35 with various configuration settings both in the component and via the HOB

Integration Instructions

Previous

use patina_dxe_core::*;

struct Q35;

impl ComponentInfo for Q35 {
  fn configs(mut add: Add<Config>) {
    add.config(patina_performance::config::PerfConfig {
      enable_component: true,
      enabled_measurements: patina::performance::Measurement::LoadImage | patina::performance::Measurement::StartImage
    }
  }
  
  fn components(mut add: Add<Component>) {
    add.component(patina_performance::component::performance_config_provider::PerformanceConfigurationProvider);
    add.component(patina_performance::component::performance::Performance);
  }
}

After

use patina_dxe_core::*;
use patina_performance::component::*;

struct Q35;

impl ComponentInfo for Q35 {
  fn components(mut add: Add<Component>) {
    // Records LoadImage and StartImage measurements unless configuration is overwritten by a HOB
    add.component(Performance::new().with_measurements(Measurement::LoadImage | Measurement::StartImage));
    
    // Disabled. Enablement fully controlled by a HOB
    add.component(Performance::new());
}

@patina-automation
Copy link
Copy Markdown
Contributor

patina-automation bot commented Apr 13, 2026

QEMU Validation Failed

QEMU validation did not complete successfully or did not shutdown as expected.

Workflow run: https://github.com/OpenDevicePartnership/patina/actions/runs/24470698740

⚠️ Build Failure Detected

The Setup and Build patina-dxe-core-qemu step failed in the following job(s):

  • Run Patina QEMU Validation / Validate QEMU Q35 (Windows)
  • Run Patina QEMU Validation / Validate QEMU - Q35 (Linux)
  • Run Patina QEMU Validation / Validate QEMU - SBSA (Linux)

Build logs are available in the workflow run artifacts:

Download the log artifacts from the workflow run to review the build output and
determine whether the error is expected.

Is this expected? If the PR introduces breaking changes to patina that
require a corresponding update to patina-dxe-core-qemu,
the build failure is expected.

Contact a repo admin or PR reviewer to override the Patina QEMU PR Validation status check.

Job Results

Job Result
Gather Incoming PR Metadata
Run Patina QEMU Validation / Post In-Progress Notification
Run Patina QEMU Validation / Preflight Checks
Run Patina QEMU Validation / Get Constants / Get Repository Constants
Run Patina QEMU Validation / Validate QEMU Q35 (Windows)
Run Patina QEMU Validation / Validate QEMU - Q35 (Linux)
Run Patina QEMU Validation / Validate QEMU - SBSA (Linux)
Run Patina QEMU Validation / Emit PR Metadata

Error Details

qemu-validation-logs-Windows-Q35/q35-windows.log (6 error/warning sections)
error[E0433]: failed to resolve: could not find `config` in `patina_performance`
  --> bin\q35_dxe_core.rs:96:40
   |
96 |         add.config(patina_performance::config::PerfConfig {
   |                                        ^^^^^^ could not find `config` in `patina_performance`


error[E0433]: failed to resolve: could not find `performance_config_provider` in `component`
   --> bin\q35_dxe_core.rs:114:54
    |
114 |         add.component(patina_performance::component::performance_config_provider::PerformanceConfigurationProvider);
    |                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ could not find `performance_config_provider` in `component`


error[E0423]: expected value, found struct `patina_performance::component::performance::Performance`
   --> bin\q35_dxe_core.rs:115:23
    |
115 |         add.component(patina_performance::component::performance::Performance);
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
   ::: D:\a\patina\patina\components\patina_performance\src\component\performance.rs:101:1
    |
101 | pub struct Performance {
    | ---------------------- `patina_performance::component::performance::Performance` defined here


error[E0603]: module `performance` is private
   --> bin\q35_dxe_core.rs:115:54
    |
115 |         add.component(patina_performance::component::performance::Performance);
    |                                                      ^^^^^^^^^^^ private module
    |
note: the module `performance` is defined here
   --> D:\a\patina\patina\components\patina_performance\src\component.rs:10:1
    |
 10 | mod performance;
    | ^^^^^^^^^^^^^^^


error: could not compile `qemu_dxe_core` (bin "qemu_q35_dxe_core") due to 4 previous errors

[cargo-make] ERROR - Error while running duckscript: Source: Unknown Line: 113 - Error while executing command, exit code: 101
qemu-validation-logs-Linux-Q35/q35-linux.log (6 error/warning sections)
error[E0433]: failed to resolve: could not find `config` in `patina_performance`
  --> bin/q35_dxe_core.rs:96:40
   |
96 |         add.config(patina_performance::config::PerfConfig {
   |                                        ^^^^^^ could not find `config` in `patina_performance`


error[E0433]: failed to resolve: could not find `performance_config_provider` in `component`
   --> bin/q35_dxe_core.rs:114:54
    |
114 |         add.component(patina_performance::component::performance_config_provider::PerformanceConfigurationProvider);
    |                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ could not find `performance_config_provider` in `component`


error[E0423]: expected value, found struct `patina_performance::component::performance::Performance`
   --> bin/q35_dxe_core.rs:115:23
    |
115 |         add.component(patina_performance::component::performance::Performance);
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
   ::: /__w/patina/patina/components/patina_performance/src/component/performance.rs:101:1
    |
101 | pub struct Performance {
    | ---------------------- `patina_performance::component::performance::Performance` defined here


error[E0603]: module `performance` is private
   --> bin/q35_dxe_core.rs:115:54
    |
115 |         add.component(patina_performance::component::performance::Performance);
    |                                                      ^^^^^^^^^^^ private module
    |
note: the module `performance` is defined here
   --> /__w/patina/patina/components/patina_performance/src/component.rs:10:1
    |
 10 | mod performance;
    | ^^^^^^^^^^^^^^^


error: could not compile `qemu_dxe_core` (bin "qemu_q35_dxe_core") due to 4 previous errors

[cargo-make] ERROR - Error while running duckscript: Source: Unknown Line: 113 - Error while executing command, exit code: 101
qemu-validation-logs-Linux-SBSA/sbsa-linux.log (6 error/warning sections)
error[E0433]: failed to resolve: could not find `config` in `patina_performance`
  --> bin/q35_dxe_core.rs:96:40
   |
96 |         add.config(patina_performance::config::PerfConfig {
   |                                        ^^^^^^ could not find `config` in `patina_performance`


error[E0433]: failed to resolve: could not find `performance_config_provider` in `component`
   --> bin/q35_dxe_core.rs:114:54
    |
114 |         add.component(patina_performance::component::performance_config_provider::PerformanceConfigurationProvider);
    |                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ could not find `performance_config_provider` in `component`


error[E0423]: expected value, found struct `patina_performance::component::performance::Performance`
   --> bin/q35_dxe_core.rs:115:23
    |
115 |         add.component(patina_performance::component::performance::Performance);
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
   ::: /__w/patina/patina/components/patina_performance/src/component/performance.rs:101:1
    |
101 | pub struct Performance {
    | ---------------------- `patina_performance::component::performance::Performance` defined here


error[E0603]: module `performance` is private
   --> bin/q35_dxe_core.rs:115:54
    |
115 |         add.component(patina_performance::component::performance::Performance);
    |                                                      ^^^^^^^^^^^ private module
    |
note: the module `performance` is defined here
   --> /__w/patina/patina/components/patina_performance/src/component.rs:10:1
    |
 10 | mod performance;
    | ^^^^^^^^^^^^^^^


error: could not compile `qemu_dxe_core` (bin "qemu_q35_dxe_core") due to 4 previous errors

[cargo-make] ERROR - Error while running duckscript: Source: Unknown Line: 113 - Error while executing command, exit code: 101

Dependencies

Repository Ref
patina e7c20dd
patina-dxe-core-qemu eebcb79
patina-fw-patcher 3960603
patina-qemu firmware v3.0.0
patina-qemu build script efe1fb2

This comment was automatically generated by the Patina QEMU PR Validation Post workflow.

@github-actions github-actions bot added impact:breaking-change Requires integration attention impact:non-functional Does not have a functional impact labels Apr 13, 2026
patina_performance has confusing configuration story. Prior to this
change, configuration was done via patina `Config`, A platform could
optionally register a secondary component that would read a HOB (if
provided) and overwrite any `Config` with the HOB configuration.

This commit works to simplify the configuration story by making a couple
of changes:

1. Removal of the `Config` object. As stated in documentation throughout
   patina, `Config` is meant for configuration that is expected to be
   shared between multiple components. This particular configuration does
   not need to be shared, so it is moved to be private configuration of
   the component.
2. Removal of the optional HOB reader driver. Now, a private
   configuration of the component will allow you to specify if the HOB
   is able to override local configuration or not.

This new story reduces patina_performance setup from three different
definitions (Config, performance component, and hob component) to only
one, the performance component.
@Javagedes Javagedes force-pushed the personal/joeyvagedes/simplify-perf-config branch from 3a36910 to 854c5b7 Compare April 13, 2026 22:28
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 94.33962% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ts/patina_performance/src/component/performance.rs 94.23% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Javagedes Javagedes requested a review from kouchekiniad April 13, 2026 22:45
Comment thread components/patina_performance/src/component/performance.rs
Comment thread components/patina_performance/src/component/performance.rs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:breaking-change Requires integration attention impact:non-functional Does not have a functional impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants